import request from "@/plugin/axios";

const BASE_URL = "sys/user";

export function UserAdd(data) {
  return request({
    url: BASE_URL,
    method: "post",
    data,
  });
}

export function UserUpdate(data) {
  return request({
    url: BASE_URL + "/" + data.id,
    method: "put",
    data,
  });
}

export function UserList(data) {
  return request({
    url: BASE_URL + "/page",
    method: "get",
    params: data,
  });
}

export function UserDetail(uid) {
  return request({
    url: BASE_URL + "/" + uid,
    method: "get",
  });
}

export function UserOrgPermBatch(data) {
  return request({
    url: BASE_URL + "/dept-perm/batch",
    method: "put",
    data,
  });
}

export function UserRolePermBatch(data) {
  return request({
    url: BASE_URL + "/role-perm/batch",
    method: "put",
    data,
  });
}

export function UserDel(uid) {
  return request({
    url: BASE_URL + "/" + uid,
    method: "delete",
  });
}

export function UserChangeStatus(uid) {
  return request({
    url: BASE_URL + "/" + uid + "/state",
    method: "put",
  });
}

export function UserResetPass(data) {
  return request({
    url: BASE_URL + "/reset-password",
    method: "put",
    data,
  });
}

export function UserResetSelfPass(data) {
  return request({
    url: BASE_URL + "/self/reset-password",
    method: "put",
    data,
  });
}
// 批量删除
export function UserdeleteUsers(data) {
  return request({
    url: BASE_URL + "/batch",
    method: "delete",
    data,
  });
}


export function UserOrg(affiliationApp,uid) {
  return request({
    url: BASE_URL + "/userOrg/" + uid,
    method: "get",
  });
}
export function UserSimpleList(organizeIds) {
  return request({
    url: BASE_URL + "/userSimple/" + organizeIds,
    method: "get",
  });
}
